Tailwind CSS offers several ways to create and style lists using utility classes.
Here are the common approaches:
Use the <ul> HTML tag to create an ordered list.
Apply the list-disc class to display disc (bullet point) markers for each list item.
<ul class="list-disc">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
Use the <ol> HTML tag to create an ordered list.
By default, Tailwind renders numbers (1, 2, 3….) as markers.
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
Tailwind provides classes for different marker styles:
<ol class="list-decimal">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
Use standard CSS properties within your Tailwind classes to style list items:
<ul class="list-disc pl-4 py-2 mb-4"> <li class="text-gray-700 font-medium">Item 1</li> <li class="text-gray-700 font-medium">Item 2</li>
<li class="text-gray-700 font-medium">Item 3</li>
</ul>